package com.test.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import java.util.HashSet;
import java.util.Set;

@Entity
public class CarRoom extends IdentifiableEntity<Long> {
     
    private String name;
     
    @OneToMany(mappedBy="room",cascade = CascadeType.PERSIST)
    private Set<Car> cars = new HashSet<Car>();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set<Car> getCars() {
        return cars;
    }

    public void setCars(Set<Car> cars) {
        this.cars = cars;
    }
}